package com.asialjim.wechat.official.message;

import com.asialjim.wechat.message.BaseWeChatCallMessage;
import com.asialjim.wechat.message.WeChatMessage;
import com.asialjim.wechat.message.WeChatMessageType;
import com.asialjim.wechat.pojo.account.WeChatAccountType;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>CLASS DESCRIPTION <i>[ NAME: OfficialCallMessage ]</i></h2><strong>
 * <p> OfficialCallMessage
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/3/8   &nbsp;&nbsp; JDK 8
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@JacksonXmlRootElement(localName = "xml")
public class OfficialCallMessage extends BaseWeChatCallMessage {

    @Override
    public Class<? extends WeChatMessage> genMessage(WeChatAccountType accountType) {
        return WeChatOfficialMessageType.typeOf(accountType,this.msgType,this.event).getMessageClass();
    }

    @Override
    public String messageTypeName(WeChatAccountType accountType) {
        return WeChatOfficialMessageType.typeOf(accountType,this.msgType,this.event).name();
    }
}